package com.twu.biblioteca;

public class LogOutMenuItem extends MenuItem{

    public LogOutMenuItem(BibliotecaApp bibliotecaAppObject)
    {
        super("Log Out",bibliotecaAppObject);
    }
    @Override
    public void takeAction() {
        if(!bibliotecaAppObject.libraryObject.checkLoggedInCurrentUser())
            System.out.println("Sorry You are not logged in");
        else
        {
            bibliotecaAppObject.libraryObject.currentUser=null;
            System.out.println("You are logged out successfully");
        }
    }
}
